using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TimerLight : FlashLight
{
    public float cycleTime = 3f;
    public float disabledPorpotion = 0.5f;
    public float startTime = 0f;

    float _Timer = 0f;

    private void Start()
    {
        _Timer = startTime;
        if (startTime > cycleTime * disabledPorpotion)
            Enable();

    }
    // Update is called once per frame
    void Update()
    {

        if (_Timer < cycleTime*disabledPorpotion && _Timer + Time.deltaTime * Time.timeScale > cycleTime * disabledPorpotion)
        {
            Enable();
        }
        if (_Timer > cycleTime)
        {
            _Timer = 0;
            Disable();
        }
        _Timer += Time.deltaTime * Time.timeScale;

    }
}
